﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MyData.Workflow.Designer;
using MyData.Common;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using MyData.Activities;
using System.Data.SqlClient;
using System.Net;

namespace WorkflowDesigner
{
  public partial class WFDForm : Form
  {
    private string _workflowPath = string.Empty;

    public WFDForm()
    {
      InitializeComponent();
    }

    private void openToolStripButton_Click(object sender, EventArgs e)
    {

      WorkflowDesignerControl wfd = (WorkflowDesignerControl)elementHost1.Child;
      OpenFileDialog openDialog = new OpenFileDialog();
      openDialog.ShowDialog();
      _workflowPath = openDialog.FileName;
      wfd.Load(_workflowPath);
    }

    private void runToolStripButton_Click(object sender, EventArgs e)
    {
      IClientActivity sampleActivity = new SampleActivity(workflowActivitiesControl1);
      sampleActivity.Run(_workflowPath);
    }
  }
}
